#ifndef _PAD_SEL_H
#define _PAD_SEL_H

#include <lib/cassert.h>
#include <parameter.h>
/*************************************************/
//保证地址对其，每四个字节为一组，刚好与复用寄存器对应。
typedef struct pad_mux_info{
    uint32_t magic;
    uint8_t rev1[12];
    uint32_t pad_sel_0;     //pad_sel_00-03
    uint32_t pad_sel_4;     //pad_sel_04-07
    uint32_t pad_sel_8;     //pad_sel_08-11
    uint32_t pad_sel_12;    //pad_sel_12-15
    uint32_t pad_sel_16;    //pad_sel_16-19
    uint32_t pad_sel_20;    //pad_sel_20-23
    uint32_t pad_sel_24;    //pad_sel_24-27
    uint32_t pad_sel_28;    //pad_sel_28-31
    uint32_t pad_sel_32;    //pad_sel_32-35
    uint32_t pad_sel_36;    //pad_sel_36-39
    uint32_t pad_sel_40;    //pad_sel_40-43
    uint32_t pad_sel_44;    //pad_sel_44-47
}pad_mux_info_t;

#define PAD_MAGIC_OFFSET					0x0
#define PAD_SEL_0_OFFSET					0x10
#define PAD_SEL_4_OFFSET					0x14
#define PAD_SEL_8_OFFSET					0x18
#define PAD_SEL_12_OFFSET					0x1C
#define PAD_SEL_16_OFFSET					0x20
#define PAD_SEL_20_OFFSET					0x24
#define PAD_SEL_24_OFFSET					0x28
#define PAD_SEL_28_OFFSET					0x2C
#define PAD_SEL_32_OFFSET					0x30
#define PAD_SEL_36_OFFSET					0x34
#define PAD_SEL_40_OFFSET					0x38
#define PAD_SEL_44_OFFSET					0x3C

CASSERT(PAD_MAGIC_OFFSET ==             \
     __builtin_offsetof(pad_mux_info_t, magic),   		\
    e1);
CASSERT(PAD_SEL_0_OFFSET ==			   \
	__builtin_offsetof(pad_mux_info_t, pad_sel_0),   \
	e2);
CASSERT(PAD_SEL_4_OFFSET ==			   \
	__builtin_offsetof(pad_mux_info_t, pad_sel_4),   \
    e3);
CASSERT(PAD_SEL_8_OFFSET ==			   \
	__builtin_offsetof(pad_mux_info_t, pad_sel_8),   \
    e4);
CASSERT(PAD_SEL_12_OFFSET ==			   \
	__builtin_offsetof(pad_mux_info_t, pad_sel_12),   \
    e5);
CASSERT(PAD_SEL_16_OFFSET ==			   \
	__builtin_offsetof(pad_mux_info_t, pad_sel_16),   \
    e6);
CASSERT(PAD_SEL_20_OFFSET ==			   \
	__builtin_offsetof(pad_mux_info_t, pad_sel_20),   \
    e7);
CASSERT(PAD_SEL_24_OFFSET ==			   \
	__builtin_offsetof(pad_mux_info_t, pad_sel_24),   \
    e8);
CASSERT(PAD_SEL_28_OFFSET ==			   \
	__builtin_offsetof(pad_mux_info_t, pad_sel_28),   \
    e9);
CASSERT(PAD_SEL_32_OFFSET ==			   \
	__builtin_offsetof(pad_mux_info_t, pad_sel_32),   \
    e10);
CASSERT(PAD_SEL_36_OFFSET ==			   \
	__builtin_offsetof(pad_mux_info_t, pad_sel_36),   \
    e11);
CASSERT(PAD_SEL_40_OFFSET ==			   \
	__builtin_offsetof(pad_mux_info_t, pad_sel_40),   \
    e12);
CASSERT(PAD_SEL_44_OFFSET ==			   \
	__builtin_offsetof(pad_mux_info_t, pad_sel_44),   \
    e13);
#endif

